/*
 * Copyright 2005 罗阳
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.maywide.jdp.dao;

import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;

import com.maywide.jdp.core.vo.Page;

/**
 * 基础DAO接口
 * 
 * @author 罗阳
 */
public interface Dao extends EntityManager {
	public void insert(Object obj) throws Exception;
	
	public void update(Object obj) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeNativeQuery(String sql,Map<String,Object> parameters,Class clazz,String resultMapName) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public Page executeNativePageQuery(String sql,String countSQL,Map<String,Object> parameters,Class clazz,String resultMapName) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeNativeQuery(String sql,Map<String,Object> parameters,Class clazz) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public Page executeNativePageQuery(String sql,String countSQL,Map<String,Object> parameters,Class clazz) throws Exception;
	
	public int executeUpdate(String hql,Map<String,Object> parameters) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeQuery(String hql,Map<String,Object> conditions,Map<String,Object> parameters) throws Exception;
	
	public Page executePageQuery(PageQueryTemplate template,Map<String,Object> conditions,Map<String,Object> parameters) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public Page executePageQuery(PageQueryTemplate template,Map<String,Object> conditions,Map<String,Object> parameters,Class clazz) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeListQuery(QueryTemplate template,Map<String,Object> conditions,Map<String,Object> parameters) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeListQuery(QueryTemplate template,Map<String,Object> conditions,Map<String,Object> parameters,Class clazz) throws Exception;

	@SuppressWarnings("rawtypes")
	public List executeNamedQuery(String name,Map<String,Object> conditions,Map<String,Object> parameters) throws Exception;
	
	@SuppressWarnings("rawtypes")
	public List executeNamedQuery(String name,Map<String,Object> conditions,Map<String,Object> parameters,Class clazz) throws Exception;
		
	@SuppressWarnings("rawtypes")
	public List executeNamedNativeQuery(String name,Map<String,Object> parameters,ISQLTranslater translater,Class clazz,String resultMapName) throws Exception;
}
